import Relay from "react-relay";

export default class SaveOrderMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { saveOrder }`;
    }

    getVariables() {
        return {
            argsInput: {
                signedContract:this.props.signedContract,
                parentId:this.props.parentId,
                createUser:this.props.createUser,
                enId:this.props.enId,
                createDate:this.props.createDate,
                account:this.props.account,
                payAccount:this.props.payAccount,
                status:this.props.status,
                orderType:this.props.orderType,
                partA:this.props.partA,
                partAName:this.props.partAName,
                partAAddress:this.props.partAAddress,
                partAUserId:this.props.partAUserId,
                partAUserName:this.props.partAUserName,
                partAPhone: this.props.partAPhone,
                partB:this.props.partB,
                partBName:this.props.partBName,
                partBAddress:this.props.partBAddress,
                partBUserId:this.props.partBUserId,
                partBUserName:this.props.partBUserName,
                partBPhone: this.props.partBPhone,
                requirement:this.props.requirement,
                rmark:this.props.rmark,
                contractId:this.props.contractId,
                traderUrl1:this.props.traderUrl1,
                traderUrl2:this.props.traderUrl2,
                traderUrl3:this.props.traderUrl3,
                traderUrl4:this.props.traderUrl4,
                traderUrl5:this.props.traderUrl5,
                contractUrl1:this.props.contractUrl1,
                contractUrl2:this.props.contractUrl2,
                contractUrl3:this.props.contractUrl3,
                contractUrl4:this.props.contractUrl4,
                contractUrl5:this.props.contractUrl5,
                goodsInfo:this.props.goodsInfo,
                deliverRequest:this.props.deliverRequest,
                traderId:this.props.traderId,
                traderUser:this.props.traderUser,
                oid:this.props.oid,
                isCreate:this.props.isCreate,
                enquiryId:this.props.enquiryId,
                traderName:this.props.traderName,
                currency: this.props.currency,
                qualityAsk:this.props.qualityAsk,
                packageAsk:this.props.packageAsk,
                logisticsAsk:this.props.logisticsAsk,
                payMode:this.props.payMode,
                dutyBreak:this.props.dutyBreak,
                checkAsk:this.props.checkAsk,
                orderClassify:this.props.orderClassify,
                makeType: this.props.makeType
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on saveOrderPayload {
            saveOrder {
                errorCode
                value
                order{
                    oid
                    status
                    orderType
                    account
                    enquiryId
                }
                otherOrder{
                    oid
                    status
                    orderType
                    account
                   
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on saveOrderPayload {
                saveOrder {
                    errorCode
                    value
                    order{
                        oid
                        status
                        orderType
                        account
                        enquiryId
                    }
                    otherOrder{
                        oid
                        status
                        orderType
                        account
                      
                    }
                }
             }
            `]
        }];
    }

}
